{include file="admin/public/header" /}
<style type="text/css">
.tab-box{height: 345px; overflow: hidden;}
.img-list{padding: 5px; height: 300px; overflow-y: scroll; display: flex; justify-content: start; flex-wrap: wrap; border: 1px dashed #999999;}
.img-list .item{width: 20%;}
.img-list .item .thumb{margin: 5px; border: 1px solid #efefef; height: 120px; border-radius: 4px; position: relative; cursor: pointer; overflow: hidden;}
.img-list .item .thumb img{width: 100%;}
.img-list .item .selected .ok{position: absolute; right: 0; bottom: 0; width: 0; height: 0; border-left: 50px solid transparent; border-bottom: 50px solid #56b0fa;}
.file-list{padding: 5px; height: 300px; overflow-y: scroll; display: flex; flex-direction: column; border: 1px dashed #999999;}
.file-list .item .attach{margin: 5px; padding: 0 10px; line-height: 35px; border: 1px solid #efefef; position: relative; cursor: pointer; overflow: hidden;}
.file-list .item .selected .ok{position: absolute; right: 0; bottom: 0; width: 0; height: 0; border-left: 50px solid transparent; border-bottom: 50px solid #56b0fa;}
.page{height: 45px;}
.page .pagination{margin: 0;}
</style>
<div class="nav-tabs-custom">
	<ul class="nav nav-tabs">
		<li><a href="{:url('/'.$from.'/upload/index', $param)}">上传{if $param['type'] == 'image'}图片{else/}文件{/if}</a></li>
		<li class="active"><a href="{:url('/'.$from.'/upload/server', $param)}">服务器{if $param['type'] == 'image'}图片{else/}文件{/if}</a></li>
	</ul>
	<div class="tab-content">
		<div class="tab-pane tab-box active" id="server">
			{if empty($list)}
			<p class="no-data">无{if $param['type'] == 'image'}图片{else/}文件{/if}</p>
			{else/}
			{if $param['type'] == 'image'}
			<div class="img-list">
				{volist name="list" id="item"}
				<div class="item">
					<div class="thumb" data-id="{$item['id']}" data-url="{$item['url']}"><img src="{$item['url']}" /><div class="ok"></div></div>
				</div>
				{/volist}
			</div>
			{else/}
			<div class="file-list">
				{volist name="list" id="item"}
				<div class="item">
					<div class="attach" data-id="{$item['id']}" data-url="{$item['url']}" data-name="{$item['name']}">{$item['name']}<div class="ok"></div></div>
				</div>
				{/volist}
			</div>
			{/if}
			{/if}
			<div class="row" style="padding-top: 10px;">
				<div class="col-xs-10 page">{$page|raw}</div>
				<div class="col-xs-2"><button class="btn btn-primary btn-block btn-select">确认选择</button></div>
			</div>
		</div>
	</div>
</div>
{include file="admin/public/footer" /}